#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>

int main()
{
  umask(0);
  int fd = open("bite",O_WRONLY | O_CREAT | O_TRUNC, 0666);
  char msg[] = "i like linux!";
  write(fd,msg,strlen(msg));

  fd = open("bite",O_RDONLY);
  char ret[sizeof(msg)] = {0};
  read(fd,ret,strlen(msg));
  printf("%s\n",ret);

  close(fd);
  return 0;
}
